<div {{ attributes }}>
    <form
        data-action="live#action:prevent"
        data-live-action-param="saveCategory"
    >

        <div class="mb-3">
            <label for="category-name">Category name:</label>
            <input
                type="text"
                data-model="name"
                class="form-control {{ _errors.has('name') ? 'is-invalid' }}"
                id="category-name"
            >
            {% if _errors.has('name') %}
                <div class="invalid-feedback">
                    {{ _errors.get('name') }}
                </div>
            {% endif %}
        </div>

        <button type="submit" id="testing-element" class="btn btn-primary">Save</button>
    </form>
</div>
